package com.commonly.dateformatting;

import java.text.SimpleDateFormat;
import java.util.Date;

public class JavaSimpleDateFormatExample {
	public static void main(String args[]) {

		// Create Date object.
		Date date = new Date();
		// Specify the desired date format
		String DATE_FORMAT = "MM/dd/yyyy";
		// Create object of SimpleDateFormat and pass the desired date format.
		SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);

		/*
		 * Use format method of SimpleDateFormat class to format the date.
		 */
		System.out.println("Today is " + sdf.format(date));

	}

}
